<template>
    <div class="type mt-1">
        <div class="title" v-if= "props.typeTopic.paperType != 6">
            <span class="font-bold">{{ toZhDigit(props.i + 1) }}、{{ props.typeTopic.name || props.textByTopicType[props.typeTopic.type] }}</span>
            (每小题{{ props.typeTopic.everyoneScore }}分，共{{ props.typeTopic.questionsList.length * props.typeTopic.everyoneScore }}分)
        </div>
        <div class="title" v-if= "props.typeTopic.paperType == 6" >
            <span class="font-bold">{{ toZhDigit(props.i + 1) }}、{{ props.typeTopic.name || props.textByTopicType[props.typeTopic.type] }}</span>
            (共{{ props.typeTopic.questionsList.length * props.typeTopic.fullScore }}分)
        </div>
        <Question
        v-for="(question, index) in props.typeTopic.questionsList"
        :key="question.id"
        :question="question"
        :showAnswer="props.showAnswer"
        :i="index"
        />
    </div>
</template>

<script setup lang="ts">
import type { QuestionItem } from '@/Utils/type';
import { toZhDigit } from '@/Utils/utils';
import Question from './Children/Question.vue';


interface QuestionsTypeVos {
    id: number;
    type: number;
    everyoneScore: number;
    fullScore: number;
    difficulty: number;
    questionsList: QuestionItem[];
    name?: string;
    paperType: number;
}

const props = defineProps<{
    typeTopic: QuestionsTypeVos;
    i: number;
    textByTopicType: any;
    showAnswer?: boolean;
}>();
</script>

<style lang="scss" scoped>
.title{
    font-size: 35px;
}
</style>